<?php exit("breakcms");?>
{include file="public/not_index_header.php"}
{if $_POST['action']=='show'}
<div class="showinfo">


</div>



<div class="showtable2_head">
    <div class="title2">权限树</div>
</div>
<br/>
<div class="treeblock">
    {foreach from="$RIGHT_TREE"}
    <div style="width: 100%" id="tree_{$item[0]}" pid="{$item['pid']}">
        {$item[2]}<span>{$item[1]}</span><span class="span_su">{$RIGHT[$item[0]]['right_node']}[{$item[0]}]</span>
    </div>
    {/foreach}
</div>

{elseif $_POST['action']=='update'}
{include file="public/message.php"}
{elseif $_POST['action']=='error'}
{include file="public/message.php"}
{/if}
{include file="public/not_index_footer.php"}


{literal}
<script language="javascript" type="text/javascript">
    hidechilds=function(num){
        var ev=window.event || arguments.callee.caller.arguments[0];
        var target= ev.target||ev.srcElement;
        $imgNUM=target.src.match(/\d+/);
        $action='show';
        switch(parseInt($imgNUM)){
            case 12:
                $action='none';
                $imgNUM=11;
                break;
            case 17:
                $action='none';
                $imgNUM=21;
                break;
            case 11:
                $action='block';
                $imgNUM=12;
                break;
            case 21:
                $action='block';
                $imgNUM=17;
                break;
        }
        target.src="system/data/treegif/"+$imgNUM+".gif";
        $div=target.parentNode;
        $parentNode=$div;
        $parentNode.setAttribute('status', $action);

        for(i=0;i<num;i++){
            $div=nextSibling($div)
            $parent=$('tree_'+$div.getAttribute('pid'));
            if($action=='none'){
                $div.style.display='none';
            }else{
                if($parent.style.display=='none'){
                    $div.style.display='none';
                }else{
                    $div.style.display=$parent.getAttribute('status')!=null?$parent.getAttribute('status'):'block';
                }
            }
        }

    }

</script>
{/literal}